package com.expressage.service.impl;

import com.expressage.dao.CityAddressDao;
import com.expressage.po.CityAddress;
import com.expressage.service.CityAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 市地址业务逻辑实现类
 */
@Service
public class CityAddressServiceImpl implements CityAddressService {

    @Autowired
    CityAddressDao cityAddressDao;

    @Override
    public List<CityAddress> findAll() {
        return cityAddressDao.findAll();
    }

    @Override
    public CityAddress findByCityid(int cityid) {
        return cityAddressDao.findByCityid(cityid);
    }

    @Override
    public CityAddress findByCityName(String cityname) {
        return cityAddressDao.findByCityName(cityname);
    }

    @Override
    public boolean insert(CityAddress cityAddress) {
        return cityAddressDao.insert(cityAddress)>0?true:false;
    }

    @Override
    public boolean delete(int[] cityid) {
        return cityAddressDao.delete(cityid)>0?true:false;
    }

    @Override
    public boolean update(CityAddress cityAddress) {
        return cityAddressDao.update(cityAddress)>0?true:false;
    }
}
